package facade;

/**
 * @ClassName FacadePatternDemo
 * @Description 门面模式
 * @Author leejiliang
 * @DateTime 2021/2/23 18:01
 * @Version 1.0
 */
public class FacadePatternDemo {


	public static void main(String[] args) {
		SystemIFacade.execute();
	}



	static class SystemIFacade{
		public static void execute(){
			final ModuleA moduleA = new ModuleA();
			final ModuleB moduleB = new ModuleB();
			final ModuleC moduleC = new ModuleC();
			moduleA.exec();
			moduleB.exec();
			moduleC.exec();
		}
	}


	interface ModuleI {
		void exec();
	}

	static class ModuleA implements ModuleI{
		@Override
		public void exec() {
			System.out.println("module A ");
		}
	}

	static class ModuleB implements ModuleI{
		@Override
		public void exec() {
			System.out.println("module B ");
		}
	}

	static class ModuleC implements ModuleI{
		@Override
		public void exec() {
			System.out.println("module C ");
		}
	}
}
